/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * EnvironmentConfigPanel.java
 *
 * Created on 07/02/2010, 11:48:41
 */
package org.p2psimulator.gui.panel;

import org.p2psimulator.config.FileSystemConfig;
import org.p2psimulator.config.ProtocolConfig;
import org.p2psimulator.entity.filesystem.FileDistTypes;
import org.p2psimulator.factory.idfactory.PeerIdFactory;

/**
 *
 * @author Amorim
 */
public class ProtocolConfigPanel extends ConfigPanel {

    /**
     * Creates new form EnvironmentConfigPanel
     */
    public ProtocolConfigPanel() {

        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        bayesianConfig = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        bayesianThresold = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        firstHandWeight = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        secondHandWeight = new javax.swing.JTextField();
        eigenConfig = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        aFactor = new javax.swing.JTextField();
        stormConfig = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        witnessesRingSize = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        feedbackNumber = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel16 = new javax.swing.JLabel();
        numberOfFiles = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        idSpaceSize = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        popularSearchProb = new javax.swing.JTextField();
        trustworthness = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        disturbingRate = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        leaveCondition = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        disturbingInteractions = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();

        setAutoscrolls(true);
        setMinimumSize(new java.awt.Dimension(185, 500));
        setPreferredSize(new java.awt.Dimension(185, 550));

        bayesianConfig.setBackground(new java.awt.Color(225, 225, 225));

        jLabel3.setBackground(java.awt.Color.white);
        jLabel3.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
        jLabel3.setText("Thresold:");

        bayesianThresold.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        bayesianThresold.setText("0.3");
        bayesianThresold.setPreferredSize(new java.awt.Dimension(25, 20));

        jLabel5.setBackground(java.awt.Color.white);
        jLabel5.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
        jLabel5.setText("A Weight:");
        jLabel5.setToolTipText("First Hand Info Weight");

        firstHandWeight.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        firstHandWeight.setText("0.8");
        firstHandWeight.setPreferredSize(new java.awt.Dimension(25, 20));

        jLabel6.setBackground(java.awt.Color.white);
        jLabel6.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
        jLabel6.setText("B Weight:");
        jLabel6.setToolTipText("Second Hand Info Weight");

        secondHandWeight.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        secondHandWeight.setText("0.5");
        secondHandWeight.setPreferredSize(new java.awt.Dimension(25, 20));

        javax.swing.GroupLayout bayesianConfigLayout = new javax.swing.GroupLayout(bayesianConfig);
        bayesianConfig.setLayout(bayesianConfigLayout);
        bayesianConfigLayout.setHorizontalGroup(
            bayesianConfigLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(bayesianConfigLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(bayesianConfigLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(bayesianConfigLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(bayesianThresold, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE)
                    .addComponent(firstHandWeight, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(secondHandWeight, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(21, 21, 21))
        );
        bayesianConfigLayout.setVerticalGroup(
            bayesianConfigLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(bayesianConfigLayout.createSequentialGroup()
                .addGroup(bayesianConfigLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(bayesianConfigLayout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addGroup(bayesianConfigLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(bayesianThresold, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel3))
                        .addGap(29, 29, 29))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, bayesianConfigLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(bayesianConfigLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(firstHandWeight, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGroup(bayesianConfigLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(secondHandWeight, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        eigenConfig.setBackground(new java.awt.Color(225, 225, 225));

        jLabel7.setBackground(java.awt.Color.white);
        jLabel7.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
        jLabel7.setText("A factor:");

        aFactor.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        aFactor.setText("0");
        aFactor.setPreferredSize(new java.awt.Dimension(25, 20));

        javax.swing.GroupLayout eigenConfigLayout = new javax.swing.GroupLayout(eigenConfig);
        eigenConfig.setLayout(eigenConfigLayout);
        eigenConfigLayout.setHorizontalGroup(
            eigenConfigLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(eigenConfigLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(aFactor, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(20, 20, 20))
        );
        eigenConfigLayout.setVerticalGroup(
            eigenConfigLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(eigenConfigLayout.createSequentialGroup()
                .addGap(7, 7, 7)
                .addGroup(eigenConfigLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(aFactor, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        stormConfig.setBackground(new java.awt.Color(225, 225, 225));

        jLabel11.setBackground(java.awt.Color.white);
        jLabel11.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
        jLabel11.setText("Ring Size:");

        witnessesRingSize.setText("5");
        witnessesRingSize.setPreferredSize(new java.awt.Dimension(25, 20));

        jLabel12.setBackground(java.awt.Color.white);
        jLabel12.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
        jLabel12.setText("FeedBack (w):");

        feedbackNumber.setText("5");
        feedbackNumber.setPreferredSize(new java.awt.Dimension(25, 20));

        javax.swing.GroupLayout stormConfigLayout = new javax.swing.GroupLayout(stormConfig);
        stormConfig.setLayout(stormConfigLayout);
        stormConfigLayout.setHorizontalGroup(
            stormConfigLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(stormConfigLayout.createSequentialGroup()
                .addGap(5, 5, 5)
                .addGroup(stormConfigLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(stormConfigLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(witnessesRingSize, javax.swing.GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE)
                    .addComponent(feedbackNumber, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(20, 20, 20))
        );
        stormConfigLayout.setVerticalGroup(
            stormConfigLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(stormConfigLayout.createSequentialGroup()
                .addGap(4, 4, 4)
                .addGroup(stormConfigLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(witnessesRingSize, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(12, 12, 12)
                .addGroup(stormConfigLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(feedbackNumber, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        jLabel1.setText("Bayesian:");

        jLabel13.setText("EigenTrust:");

        jLabel14.setText("STORM:");

        jPanel2.setBackground(new java.awt.Color(225, 225, 225));

        jLabel16.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
        jLabel16.setText("Files:");

        numberOfFiles.setText("10000");
        numberOfFiles.setPreferredSize(new java.awt.Dimension(25, 20));

        jLabel17.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
        jLabel17.setText("Id space size:");

        idSpaceSize.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        idSpaceSize.setText("14");
        idSpaceSize.setPreferredSize(new java.awt.Dimension(25, 20));

        jLabel18.setBackground(new java.awt.Color(225, 225, 225));
        jLabel18.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
        jLabel18.setText("Probability:");
        jLabel18.setToolTipText("Popular Search Probability");

        popularSearchProb.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        popularSearchProb.setText("0.6");
        popularSearchProb.setPreferredSize(new java.awt.Dimension(25, 20));

        trustworthness.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        trustworthness.setText("0.2");
        trustworthness.setPreferredSize(new java.awt.Dimension(25, 20));

        jLabel4.setBackground(java.awt.Color.white);
        jLabel4.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
        jLabel4.setText("Min. Trust:");
        jLabel4.setToolTipText("Min. Trust Worthness:");

        disturbingRate.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        disturbingRate.setText("0.7");
        disturbingRate.setPreferredSize(new java.awt.Dimension(25, 20));

        jLabel8.setBackground(java.awt.Color.white);
        jLabel8.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
        jLabel8.setText("Rate:");

        jLabel9.setBackground(java.awt.Color.white);
        jLabel9.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
        jLabel9.setText("Min. Rep.:");

        leaveCondition.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        leaveCondition.setText("0.2");
        leaveCondition.setPreferredSize(new java.awt.Dimension(25, 20));

        jLabel10.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
        jLabel10.setText("Interactions:");

        disturbingInteractions.setText("3");
        disturbingInteractions.setPreferredSize(new java.awt.Dimension(25, 20));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(numberOfFiles, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel17)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(idSpaceSize, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(1, 1, 1))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4)
                            .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel9)
                            .addComponent(jLabel10))
                        .addGap(21, 21, 21)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(popularSearchProb, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(trustworthness, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(disturbingRate, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE)
                            .addComponent(leaveCondition, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(disturbingInteractions, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel16)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(numberOfFiles, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(3, 3, 3)))
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17)
                    .addComponent(idSpaceSize, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(popularSearchProb, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(trustworthness, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(disturbingRate, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(leaveCondition, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(disturbingInteractions, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );

        jLabel2.setText("General:");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel13)
                    .addComponent(jLabel1)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bayesianConfig, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(eigenConfig, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel2)
                    .addComponent(jLabel14)
                    .addComponent(stormConfig, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(bayesianConfig, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel13)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(eigenConfig, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel14)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(stormConfig, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(51, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField aFactor;
    private javax.swing.JPanel bayesianConfig;
    private javax.swing.JTextField bayesianThresold;
    private javax.swing.JTextField disturbingInteractions;
    private javax.swing.JTextField disturbingRate;
    private javax.swing.JPanel eigenConfig;
    private javax.swing.JTextField feedbackNumber;
    private javax.swing.JTextField firstHandWeight;
    private javax.swing.JTextField idSpaceSize;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JTextField leaveCondition;
    private javax.swing.JTextField numberOfFiles;
    private javax.swing.JTextField popularSearchProb;
    private javax.swing.JTextField secondHandWeight;
    private javax.swing.JPanel stormConfig;
    private javax.swing.JTextField trustworthness;
    private javax.swing.JTextField witnessesRingSize;
    // End of variables declaration//GEN-END:variables

    public ProtocolConfig getProtocolConfig() {

        ProtocolConfig cfg = new ProtocolConfig(
                mainFrame.getSimulationConfigPanel().getProtocolType(),
                new PeerIdFactory(getIdSpaceSize()));

        cfg.setBayesianFirstHandWeight(getFirstHandWeight());
        cfg.setBayesianSecondHandWeight(getSecondHandWeight());
        cfg.setBayesianThresold(getBayesianThresold());
        cfg.setEigenAfactor(getaFactor());
        cfg.setEigenBasicTrust(getTrustworthness());
        cfg.setBayesianTrustWorthiness(getTrustworthness());
        cfg.setStormWitnessSize(getWitnessesRingSize());
        cfg.setStormFeedbackNumber(getFeedbackNumber());
        return cfg;
    }
    public FileSystemConfig getFileSystemConfig() {
        FileSystemConfig cfg = new FileSystemConfig(getIdSpaceSize(), FileDistTypes.POWER);
        cfg.setPopularSearchProb(getPopularSearchProb());
        cfg.setNumberOfFiles(getNumberOfFiles());
        return cfg;
    }

     public double getPopularSearchProb() {
        try {
            return new Double(popularSearchProb.getText());
        } catch (Exception e) {
            mainFrame.getConsoleLogger().addError("Env.: Popular Search Prob must have a numeric value between 0 and 1");
            return 0;
        }
    }

    public void setPopularSearchProb(double popularSearchProb) {
        this.popularSearchProb.setText("" + popularSearchProb);
    }

    public double getNumberOfFiles() {
        try {
            return new Double(numberOfFiles.getText());
        } catch (Exception e) {
            mainFrame.getConsoleLogger().addError("Env.: Number of must have a numeric value between 0 and 1");
            return 0;
        }
    }

    public void setNumberOfFiles(double numberOfFiles) {
        this.numberOfFiles.setText("" + numberOfFiles);
    }
    public double getaFactor() {
        try {
            return new Double(aFactor.getText());
        } catch (Exception e) {
            mainFrame.getConsoleLogger().addError("Env.: AFactor rate must have a numeric value");
            return 0;
        }
    }

    public void setaFactor(double aFactor) {
        this.aFactor.setText("" + aFactor);
    }

    public double getBayesianThresold() {
        try {
            return new Double(bayesianThresold.getText());
        } catch (Exception e) {
            mainFrame.getConsoleLogger().addError("Env.: Thresold rate must have a numeric value");
            return 0;
        }
    }

    public void setBayesianThresold(double bayesianThresold) {
        this.bayesianThresold.setText("" + bayesianThresold);
    }

    public double getDisturbingRate() {
        try {
            return new Double(disturbingRate.getText());
        } catch (Exception e) {
            mainFrame.getConsoleLogger().addError("Env.: Disturbing rate must have a numeric value");
            return 0;
        }
    }

    public void setDisturbingRate(double disturbingRate) {
        this.disturbingRate.setText("" + disturbingRate);
    }

    public double getFirstHandWeight() {
        try {
            return new Double(firstHandWeight.getText());
        } catch (Exception e) {
            mainFrame.getConsoleLogger().addError("Env.: FirstHand Weight must have a numeric value");
            return 0;
        }
    }

    public void setFirstHandWeight(double firstHandWeight) {
        this.firstHandWeight.setText("" + firstHandWeight);
    }

    public double getLeaveCondition() {
        try {
            return new Double(leaveCondition.getText());
        } catch (Exception e) {
            mainFrame.getConsoleLogger().addError("Env.: LeaveCondition must have a numeric value");
            return 0;
        }
    }

    public void setLeaveCondition(double leaveCondition) {
        this.leaveCondition.setText("" + leaveCondition);
    }

    public double getSecondHandWeight() {
        try {
            return new Double(secondHandWeight.getText());
        } catch (Exception e) {
            mainFrame.getConsoleLogger().addError("Env.: SecondHand Weight must have a numeric value");
            return 0;
        }
    }

    public void setSecondHandWeight(double secondHandWeight) {
        this.secondHandWeight.setText("" + secondHandWeight);
    }

    public double getTrustworthness() {
        try {
            return new Double(trustworthness.getText());
        } catch (Exception e) {
            mainFrame.getConsoleLogger().addError("Env.: Trustwothness must have a numeric value");
            return 0;
        }
    }

    public void setTrustworthness(double trustworthness) {
        this.trustworthness.setText("" + trustworthness);
    }

    public double getDisturbingInteractions() {
        try {
            return new Double(disturbingInteractions.getText());
        } catch (Exception e) {
            mainFrame.getConsoleLogger().addError("Env.: Disturbing Interactions must have a numeric value");
            return 0;
        }
    }

    public void setDisturbingInteractions(double disturbingInteractions) {
        this.disturbingInteractions.setText("" + disturbingInteractions);
    }

    public double getWitnessesRingSize() {
        try {
            return new Double(witnessesRingSize.getText());
        } catch (Exception e) {
            mainFrame.getConsoleLogger().addError("Env.: Witnesses Ring Size must have a numeric value");
            return 0;
        }
    }

    public void setWitnessesRingSize(double witnessesRingSize) {
        this.witnessesRingSize.setText("" + witnessesRingSize);
    }

    public double getFeedbackNumber() {
        try {
            return new Double(feedbackNumber.getText());
        } catch (Exception e) {
            mainFrame.getConsoleLogger().addError("Env.: FeedBack Number must have a numeric value");
            return 0;
        }
    }

    public void setFeedbackNumber(double feedbackNumber) {
        this.feedbackNumber.setText("" + feedbackNumber);
    }
    public int getIdSpaceSize() {
        try {
            return new Integer(idSpaceSize.getText());
        } catch (Exception e) {
            mainFrame.getConsoleLogger().addError("Env.: Id Space must have a numeric value");
            return 0;
        }
    }

    public void setIdSpaceSize(int idSpaceSize) {
        this.idSpaceSize.setText("" + idSpaceSize);
    }
}
